using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NCS.Library.Utilities;

namespace NCS.Portal.Administrator.UserControls
{
    public partial class SelectDate : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public DateTime GetCurrentDate()
        {
            DateTime retVal = new DateTime(ConvertUtility.ToInt32(dropYear.SelectedValue), ConvertUtility.ToInt32(dropMonth.SelectedValue), ConvertUtility.ToInt32(dropDay.SelectedValue));
            return retVal;
        }

        public void SetDate(DateTime date)
        {
            MiscUtility.FillIndex(dropDay, 1, 31, date.Day);
            MiscUtility.FillIndex(dropMonth, 1, 12, date.Month);
            MiscUtility.FillIndex(dropYear, date.Year - 120, date.Year, date.Year);
        }
    }
}